// import {useState} from "react";
// export default function UseStateExample(){
//     let [count,setCount] = useState(0);
// }

import { useState } from "react";

export default function Demo() {
    // var count = 12;
    var [count, setCcount] = useState(12);
    var counter = e => {
        console.log("here")
        // count++;
        setCcount(count + 1);
        // count=count+1;
    };
    let [desc, setDesc] = useState("");
    console.log("render");

    var inputDesc = (e)=>{
        console.log("input change");
        // console.log(e.target.value);
        setDesc(e.target.value);
    }
    return (
        <div>
            <div>
                <textarea onInput={inputDesc} value={desc}></textarea>
                <div>解析后生成的文本：{desc}</div>
            </div>
            累计次数:{count}<br />
            <button onClick={counter}>累加</button>
            </div>
    )
}

// function _inherits(subClass, superClass) { 
//     if (typeof superClass !== "function" && superClass !== null) { 
//         throw new TypeError("Super expression must either be null or a function"); 
//     } 
//     subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
